package cn.weiyang.testFile;

import java.io.File;

public class FileTree {
	public static void main(String[] args){
		File f=new File("C:/Widows");
		printFileTree(f,0);
	}
	public static void printFileTree(File file,int level){
		for(int i=0;i<level;i++){
			System.out.print("-");
		}
		System.out.println(file.getName());
		if(file.isDirectory()){
			File[] files=file.listFiles();
			for(File temp:files){
				printFileTree(temp,level+1);
			}
			/*for(int i=0;i<files.length;i++){
				printFileTree(files[i],level+1);
			}*/
			
		}
	}

}
